/*
 * File Name:               UILocalization.cs
 * 
 * Description:             普通类
 * Author:                  zhangke <kris@zhanng.org>

 * Create Date:             2017/07/18
 */

using UnityEngine;
using UnityEngine.UI;


[DisallowMultipleComponent]
public class UILocalization : MonoBehaviour
{
    [System.Serializable]
    public class Data
    {
        /// <summary>
        /// 本地化索引ID
        /// </summary>
        public string localization_key;
        /// <summary>
        /// 需要显示文字的组件
        /// </summary>
        public Text textComponent;
    }

    public Data[] components;

    private void Awake()
    {
        for (int i = 0; i < components.Length; i++)
        {
            var c = components[i];
            var target = c.textComponent;
            if (target == null)
            {
#if UNITY_EDITOR && !ENABLE_DEEP_PROFILER
                Debug.LogError("ui: " + name + " 没有设置Text组件!!!");
#endif
                continue;
            }

            //target.text = LocalizationDataModule.Instance.GetLocalizedText(c.localization_key);
        }
    }
}
